home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / shell / shark.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1996-11-16  |  20.3 KB  |  518 lines

  1. #!/bin/sh
  2. ########################################################
  3. # This is a shell archive  --- shark 0.1.1 ---         #
  4. # Please remove any lines before this header and       #
  5. # run     sh this-file-name     to extract all files.  #
  6. # 1994 (C) Fernando J G Pereira - fjp@minerva.inesc.pt #
  7. ########################################################
  8. echo unsharking shark
  9. mkdir shark
  10. echo unsharking shark/shark.c
  11. cat > shark/shark.c << '\\__END__OF__shark/shark.c__FILE\\'
  12. /******************************************************************************
  13. * shark - shell archiver.                              *
  14. *                                          *
  15. * This is free software - you are free to use it and distribute it as long as *
  16. * this message appears in the source code and archive headers.                *
  17. * There is no explicit or implicit WARRANTY in the usage of this program.     *
  18. * You are free to use it at your own risk (including all kinds of possible    *
  19. * damages).                                               *
  20. *                                          *
  21. *                15/Feb/94                      *
  22. *                                          *
  23. *                 Fernando Pereira - fjp@minerva.inesc.pt                     *
  24. ******************************************************************************/
  25.  
  26.  
  27.  
  28.  
  29. #include <stdlib.h>
  30. #include <unistd.h>
  31. #include <stdio.h>
  32. #include <dirent.h>
  33. #include <sys/stat.h>
  34. #include <fcntl.h>
  35. #include <ctype.h>
  36.  
  37.  
  38. #define LINE_SIZE 1024
  39. #define SCAN_SIZE 2048
  40.  
  41. FILE *arch = stdout;
  42.  
  43. void archive( char *file );
  44. void archive_dir( char* file, struct stat *info );
  45. void archive_file( char* file, struct stat *info );
  46. void archive_link( char *file, struct stat *info );
  47. void archive_char_dev( char *file, struct stat *info );
  48. void archive_block_dev( char *file, struct stat *info );
  49. void archive_pipe( char *file, struct stat *info );
  50. int is_bin( char *file );
  51.  
  52.  
  53.  
  54.  
  55. int main( int argc, char **argv )
  56. {
  57.     int i = 1;
  58.  
  59.     while( argv[i] && argv[i][0] == '-' ) {
  60.     switch( argv[i][1] ) {
  61.         case 'o':
  62.             ++i;
  63.             if( argv[i] == 0 ) exit( 1 );
  64.             arch = fopen( argv[i], "w" );
  65.         fchmod( fileno( arch ), 0755 );
  66.         break;
  67.         case 'h':
  68.         default:
  69.             fprintf( stderr, "usage: shark [-o output-file] files\n");
  70.             exit( 0 );
  71.     }
  72.     ++i;
  73.     }
  74.  
  75.     fprintf(arch,"#!/bin/sh\n" );
  76.     fprintf(arch,"########################################################\n" );
  77.     fprintf(arch,"# This is a shell archive  --- shark 0.1.1 ---         #\n" );
  78.     fprintf(arch,"# Please remove any lines before this header and       #\n" );
  79.     fprintf(arch,"# run     sh this-file-name     to extract all files.  #\n" );
  80.     fprintf(arch,"# 1994 (C) Fernando J G Pereira - fjp@minerva.inesc.pt #\n" );
  81.     fprintf(arch,"########################################################\n" );
  82.  
  83.     while( i < argc ) archive( argv[i++] );
  84. }
  85.  
  86.  
  87.  
  88.  
  89. void archive( char *file )
  90. {
  91.     struct stat info;
  92.  
  93.     if( lstat( file, &info ) < 0 ) {
  94.         perror( file );
  95.         return;
  96.     }
  97.     fprintf( stderr, "sharking %s\n", file );
  98.     fprintf( arch, "echo unsharking %s\n", file );
  99.  
  100.     if( S_ISDIR( info.st_mode ) ) archive_dir( file, &info );
  101.     else if( S_ISREG( info.st_mode ) ) archive_file( file, &info );
  102.     else if( S_ISFIFO( info.st_mode ) ) archive_pipe( file, &info );
  103.     else if( S_ISBLK( info.st_mode ) ) archive_block_dev( file, &info );
  104.     else if( S_ISCHR( info.st_mode ) ) archive_char_dev( file, &info );
  105.     else if( S_ISLNK( info.st_mode ) ) archive_link( file, &info );
  106.     else fprintf( stderr, "Unable to shark file: %s\n", file );
  107. }
  108.  
  109.  
  110. /* We will only be able to store MAX_FILES_OPEN sub-directory levels ... */
  111.  
  112. void archive_dir( char* file, struct stat *info )
  113. {
  114.     char path[LINE_SIZE+1];
  115.     struct dirent *ent;
  116.     DIR *dir;
  117.  
  118.     if( strcmp( file, "." ) && strcmp( file, ".." ) )
  119.     fprintf( arch, "mkdir %s\n", file );
  120.  
  121.     dir = opendir( file );
  122.     if( dir == NULL ) {
  123.         perror( file );
  124.         return;
  125.     }
  126.  
  127.     while( ent = readdir( dir ) ) {
  128.         ent->d_name[ent->d_reclen] = '\0';
  129.     if( strcmp( ent->d_name, "." ) && strcmp( ent->d_name, ".." ) ) {
  130.         sprintf( path, "%s/%s", file, ent->d_name );
  131.         archive( path );
  132.     }
  133.     }
  134.  
  135.     closedir( dir );
  136.  
  137.     fprintf( arch, "chmod %o %s\n", 07777&info->st_mode, file );
  138. }
  139.  
  140.  
  141.  
  142. /* Maybe a Bug: If a text file doesn't end with a '\n', it will be appended */
  143.  
  144. void archive_file( char* file, struct stat *info )
  145. {
  146.     char cmd[LINE_SIZE+1];
  147.     FILE *fptr;
  148.     int d, n, lc = '\n';
  149.     unsigned char c;
  150.  
  151.     if( is_bin( file ) ) {
  152.     sprintf( cmd, "uuencode %s %s", file, file );
  153.     fptr = popen( cmd, "r" );
  154.     if( fptr == NULL ) {
  155.         perror( cmd );
  156.         return;
  157.     }
  158.     fprintf( arch, "uudecode << '\\\\__END__OF__%s__FILE\\\\'\n", file );
  159.     }
  160.     else {
  161.     fptr = fopen( file, "r" );
  162.     if( fptr == NULL ) {
  163.         perror( file );
  164.         return;
  165.     }
  166.         fprintf(arch, "cat > %s << '\\\\__END__OF__%s__FILE\\\\'\n",file,file);
  167.     }
  168.  
  169.  
  170.     for(;;) {
  171.     c = getc( fptr );
  172.     if( feof( fptr ) ) break;
  173.     putc( c, arch );
  174.     lc = c;
  175.     }
  176.  
  177.     if( lc != '\n' ) putc( '\n', arch );
  178.     fprintf( arch, "\\\\__END__OF__%s__FILE\\\\\n", file );
  179.     fprintf( arch, "chmod %o %s\n", 07777&info->st_mode, file );
  180.  
  181.     fclose( fptr );
  182. }
  183.  
  184.  
  185.  
  186. void archive_pipe( char *file, struct stat *info )
  187. {
  188.     fprintf( arch, "mknod -m %o %s p\n", file, 07777&info->st_mode );
  189. }
  190.  
  191.  
  192.  
  193. void archive_block_dev( char *file, struct stat *info )
  194. {
  195.     fprintf( arch, "mknod -m %o %s b %d %d\n", 07777&info->st_mode, file,
  196.              (info->st_rdev&0xff00)>>8, info->st_rdev & 0xff );
  197. }
  198.  
  199.  
  200.  
  201. void archive_char_dev( char *file, struct stat *info )
  202. {
  203.     fprintf( arch, "mknod -m %o %s c %d %d\n", 07777 & info->st_mode, file,
  204.              (info->st_rdev&0xff00)>>8, info->st_rdev & 0xff );
  205. }
  206.  
  207.  
  208.  
  209. void archive_link( char *file, struct stat *info )
  210. {
  211.     char path[LINE_SIZE+1];
  212.     int n;
  213.  
  214.     n = readlink( file, path, LINE_SIZE );
  215.  
  216.     if( n <= 0 ) {
  217.     perror( file );
  218.     return;
  219.     }
  220.  
  221.     path[n] = '\0';
  222.     fprintf( arch, "ln -s %s %s\n", path, file );
  223. }
  224.  
  225.  
  226. /*Test if a file is binary: Fails if the first SCAN_SIZE chars are all ASCII.*/
  227.  
  228. int is_bin( char *file )
  229. {
  230.     int n, d;
  231.     char buff[SCAN_SIZE+1];
  232.  
  233.     d = open( file, O_RDONLY );
  234.     if( d == -1 ) {
  235.     perror( file );
  236.     return;
  237.     }
  238.  
  239.     n = read( d, buff, SCAN_SIZE );
  240.     close( d );
  241.  
  242.     while( --n >= 0 ) if( buff[n] != '\0' && !isascii( buff[n] ) ) return 1;
  243.  
  244.     return 0;
  245. }
  246. \\__END__OF__shark/shark.c__FILE\\
  247. chmod 644 shark/shark.c
  248. echo unsharking shark/shark
  249. uudecode << '\\__END__OF__shark/shark__FILE\\'
  250. begin 755 shark/shark
  251. M"P%D```0````$```````````````````````````````````````````````
  252. M````````````````````````````````````````````````````````````
  253. M````````````````````````````````````````````````````````````
  254. M````````````````````````````````````````````````````````````
  255. M````````````````````````````````````````````````````````````
  256. M````````````````````````````````````````````````````````````
  257. M````````````````````````````````````````````````````````````
  258. M````````````````````````````````````````````````````````````
  259. M````````````````````````````````````````````````````````````
  260. M````````````````````````````````````````````````````````````
  261. M````````````````````````````````````````````````````````````
  262. M````````````````````````````````````````````````````````````
  263. M````````````````````````````````````````````````````````````
  264. M````````````````````````````````````````````````````````````
  265. M````````````````````````````````````````````````````````````
  266. M````````````````````````````````````````````````````````````
  267. M````````````````````````````````````````````````````````````
  268. M````````````````````````````````````````````````````````````
  269. M````````````````````````````````````````````````````````````
  270. M````````````````````````````````````````````````````````````
  271. M````````````````````````````````````````````````````````````
  272. M````````````````````````````````````````````````````````````
  273. M`````````````````````````````````````````````.A/"P``N"T```"[
  274. M`````,V`HUP+"6"+1"0(HS0+"6`/MP44$```4.A`#```@\0$Z'@,``#H>P$`
  275. M`%#HD0,`8%NX`0```,V`Z_>0D)"0D)"0`)"0D'<`=7-A9V4Z('-H87)K(%LM
  276. M;R!O=71P=70M9FEL95T@9FEL97,*`",A+V)I;B]S:`H`(R,C(R,C(R,C(R,C
  277. M(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,*
  278. M`",@5&AI<R!I<R!A('-H96QL(&%R8VAI=F4@("TM+2!S:&%R:R`P+C$N,2`M
  279. M+2T@("`@("`@("`C"@`C(%!L96%S92!R96UO=F4@86YY(&QI;F5S(&)E9F]R
  280. M92!T:&ES(&AE861E<B!A;F0@("`@("`@(PH`(R!R=6X@("`@('-H('1H:7,M
  281. M9FEL92UN86UE("`@("!T;R!E>'1R86-T(&%L;"!F:6QE<RX@(",*`",@,3DY
  282. M-"`H0RD@1F5R;F%N9&\@2B!'(%!E<F5I<F$@+2!F:G!`;6EN97)V82YI;F5S
  283. M8RYP="`C"@"0D)"0D)"0D)"0D)!5B>575E.+?0SH4@@``+X!````@W\$``^$
  284. MEP```(M'!(`X+0^%BP```(U?!(L#BD`!/&AT2SQO=4>#PP1&@SL`=0YJ`>C3
  285. M`0!@D)"0D)"0D&A4````BQ-2Z%\"`&"C!!```&CM`0``4.@W`@!@@\0$4.BN
  286. M`0!@@\00ZR60D)"0D&A6````:-0'"6#H10(`8&H`Z(8!`&"0D)"0D)"0D)"0
  287. M@\,$1H,[`'0+BP.`."T/A'C___]H>P```(L5!!```%+H#P(`8&B&````BQ4$
  288. M$```4NC^`0!@:,````"+%000``!2Z.T!`&!H^@```(L5!!```%+HW`$`8(/$
  289. M(&@T`0``BQ4$$```4NC(`0!@:&X!``"+%000``!2Z+<!`&!HA@```(L5!!``
  290. M`%+HI@$`8(/$&#EU"'X<C1RWBU4(C327D(L34H/#!.A5````@\0$.?-\[HUE
  291. M]%M>7XGL7<-S:&%R:VEN9R`E<PH`96-H;R!U;G-H87)K:6YG("5S"@!5;F%B
  292. M;&4@=&\@<VAA<FL@9FEL93H@)7,*`)"0D)"0D)"0D%6)Y8/L0%93BW4(C5W`
  293. M4U;H)P4`8(/$"(7`?116Z'(&`&#IJ0```)"0D)"0D)"0D%9H$`,``&C4!PE@
  294. MZ/0``&!6:!T#``"+%000``!2Z.(``&!FBT7(9B4`\(/$&&8]`$!U#5-6Z)8`
  295. M``#K9)"0D)!F/0"`=0I35N@S`@``ZU&09CT`$'4*4U;HXP,``.M!D&8]`&!U
  296. M"E-6Z",$``#K,9!F/0`@=0I35NAC!```ZR&09CT`H'4*4U;HDP0``.L1D%9H
  297. M,0,``&C4!PE@Z&0``&"-9;A;7HGL7<,N`"XN`&UK9&ER("5S"@`E<R\E<P!C
  298. M:&UO9"`E;R`E<PH`D)"0D)!5B>6![`P$``!75E.+=0B_+00``+D"````_*@`
  299. M\Z9T+(MU"+\O!```N0,```#\J`#SIG08BUT(4V@R!```BQT$$```4^CK__]?
  300. M@\0,BUT(4^@'!0!@B87X^___@\0$A<!U#E/H+`4`8.FQ````D)"0C9W\^___
  301. MB9WT^___BYWX^___4^@$!@!@B<*#Q`2%TG1?#[="",9$$`H`C4(*B<:_+00`
  302. M`+D"````_*@`\Z9TS(G&OR\$``"Y`P```/RH`/.F=+E0BUT(4V@\!```BYWT
  303. M^___4^B#"`!@4^@A_O__@\04ZYB0D)"0D)"0D)"0D)"+G?C[__]3Z`C]_U^+
  304. M70A3BUT,9HM#""7_#P``4&A"!```BQT$$```4^@6__]?C:7H^___6UY?B>Q=
  305. MPW5U96YC;V1E("5S("5S`'(`=75D96-O9&4@/#P@)UQ<7U]%3D1?7T]&7U\E
  306. M<U]?1DE,15Q<)PH`8V%T(#X@)7,@/#P@)UQ<7U]%3D1?7T]&7U\E<U]?1DE,
  307. M15Q<)PH`7%Q?7T5.1%]?3T9?7R5S7U]&24Q%7%P*`)"0D)"0D)"0D)"0D)!5
  308. MB>6![`@$``!75E.+?0C'A?C[__\*````5^CA`@``@\0$A<!T6E=7:'\%``"-
  309. MG?S[__]3Z','`&!HC@4``%/HL`,`8(G&@\08A?9U$U/HD0,`8.E%`0``D)"0
  310. MD)"0D)!7:)`%``"+#000``!1Z!+^_U^#Q`SK09"0D)"0D)"0D&B.!0``5^CA
  311. M_?]?B<:#Q`B%]G4,5^A*`P!@Z?X```"05U=HMP4``(L-!!```%'HT?W_7X/$
  312. M$)"0BT8$.48(=PY6Z![Z_U^#Q`2#^/]T$HM&!(H8_T8$ZPJ0D)"0D)"0D+/_
  313. M5N@<_?]?@\0$A<!U08L5!!```(M"%#E"&'<3#[;#4%+HA?G_7X/$".L)D)"0
  314. MD(@8_T(4@>/_````B9WX^___ZY60D)"0D)"0D)"0D)"0@[WX^___"G0MH000
  315. M``"+4!0Y4!AW&FH*4.@^^?]?@\0(ZQ.0D)"0D)"0D)"0D)"0Q@(*_T`45VC>
  316. M!0``BPT$$```4>@,_?]?5XM-#&:+00@E_P\``%!H0@0``(L-!!```%'H[?S_
  317. M7U;H1_S_7XVE[/O__UM>7XGL7<-M:VYO9"`M;2`E;R`E<R!P"@"0D)"058GE
  318. MBT4,9HM`""7_#P``4(M5"%)HK@<``(L5!!```%+HG_S_7XGL7<-M:VYO9"`M
  319. M;2`E;R`E<R!B("5D("5D"@"0D)"0D)"0D)"0D)"0D)!5B>6+50P/MD(04`^V
  320. M0A%0BTT(46:+0@@E_P\``%!H[0<``(L-!!```%'H1?S_7XGL7<-M:VYO9"`M
  321. M;2`E;R`E<R!C("5D("5D"@"0D)"0D%6)Y8M5#`^V0A!0#[9"$5"+30A19HM"
  322. M""7_#P``4&A'"```BPT$$```4>CU^_]?B>Q=PVQN("US("5S("5S"@!5B>6!
  323. M[`0$``!64XM="&@`!```C;7\^___5E/H)`(`8(/$#(7`?PE3Z!<!`&#K')#&
  324. MA"C\^___`%-6:)<(``"+%000``!2Z)G[_U^-I?3[__];7HGL7<.0D)"0D)"0
  325. MD)!5B>6![`0(``!64XM="&H`4^B.``!@B<:#Q`B#_O]U(%/HO@``8.M)D)"0
  326. MD)"0D)"X`0```.LZD)"0D)"0D)"0:``(``"-A?SW__]05NB"`0!@B<-6Z/+X
  327. M_U_K$)"0D)"`O"O\]___`'0"?,1+>?$QP(VE]/?__UM>B>Q=PY"0D%6)Y5.A
  328. M>!```(/X_W49,<"#/7P0````=`Z0D)!`@SR%?!````!U]8G#A=MT#Y"0D(L$
  329. MG7@0``#_T$MU](M=_(GL7<.0D)"0D)"0D)"0D)"058GE4[M,$```@SU,$```
  330. M`'0.D)"+`X/#!/_0@SL`=?1HA`D``.B:]_]?BUW\B>Q=PY"0D)"0D)"0D)"0
  331. MD)"0D%6)Y8,]#!````!U#\<%#!````$```#HI?___XGL7<.04[@!````BUPD
  332. M",V`A<!]$/?8HQP0``"X_____UO#D)!;PY"0D)"0D)"0D)"0D)"04[A6````
  333. MBUPD",V`A<!]$/?8HQP0``"X_____UO#D)!;PY"0D)"0D)"0D)"0D)"04[@$
  334. M````BUPD"(M,)`R+5"00S8"%P'T8]]BC'!```+C_____6\.0D)"0D)"0D)"0
  335. M6\.0D)"0D)"0D)"0D)"0D%.X6P```(M<)`B+3"0,S8"%P'T<]]BC'!```+C_
  336. M____6\.0D)"0D)"0D)"0D)"0D%O#+VQI8B]L9"YS;P`Z(&-A;B=T(&QO860@
  337. M9'EN86UI8R!L:6YK97(@)R]L:6(O;&0N<V\G"@`)<W1A=&EC86QL>2!L:6YK
  338. M960*`)"0D)"0@^PX55=64XML)$R+7"10@SU`$`````^$M````,=$)$0@`/!B
  339. M:`8+``#HXO[__X/$!(7`=%N+`XU\)!B^$0L``/RY"@```/.E9J6%P'0<@#@`
  340. M=`>00(`X`'7Z*P-0BQM3:@+HV?[__X/$#&HJC40D'%!J`NC(_O__@\0,D&B`
  341. M````Z%K^__^#Q`3K\9"0D)"0:%00``!H.!```(M4)%Q2BQM3C40D(%"X`@``
  342. M`(7M?P6X`0```%"+1"1<_]"+5"0L4HM4)"Q2Z+7^__^#Q"#K)HU\)!B^.PL`
  343. M`/RY!0```/.EA>U_*VH4C40D'%!J`NA-_O__@\0,A>U_%I"0:@#HW?W__X/$
  344. M!.OTD)"0D)"0D)!;7E]=@\0XPX/L!&:+5"0(9H72=06Z<A,``-E\)`)FBT0D
  345. M`F8EP/!FB40D`HG09B4_#V:+5"0"9@G09HE$)`+9;"0"@\0$PY!55U93BVPD
  346. M%(M\)!B+="0<NX00``"#/800````=!20D%9758L#_]"#Q`R#PP2#.P!U[EM>
  347. M7UW#D&QI8F,N<V\N-`!$3$P@2G5M<"`T+C5P;#$Y`)``````````````````
  348. M````````````````````````````````````````````````````````````
  349. M````````````````````````````````````````````````````````````
  350. M````````````````````````````````````````````````````````````
  351. M````````````````````````````````````````````````````````````
  352. M````````````````````````````````````````````````````````````
  353. M````````````````````````````````````````````````````````````
  354. M````````````````````````````````````````````````````````````
  355. M````````````````````````````````````````````````````````````
  356. M````````````````````````````````````````````````````````````
  357. M````````````````````````````````````````````````````````````
  358. M````````````````````````````````````````````````````````````
  359. M````````````````````````````````````````````````````````````
  360. M````````````````````````````````````````````````````````````
  361. M````````````````````````````````````````````````````````````
  362. M````````````````````````````````````````````````````````````
  363. M````````````````````````````````````````````````````````````
  364. M``````````````````````````````````````````````#3'NO^B`8)8!`0
  365. M````````````````D)````````````````#D#```[@P``````&`'`@0``/`(
  366. M8`(```#\#P``)!`````````!````^#\`8``````#`````!```'`0```T$```
  367. M````````````````````````````````````````````````````````````
  368. M````````````````````````````````````````````````````````````
  369. M````````````````````````````````````````````````````````````
  370. M````````````````````````````````````````````````````````````
  371. M````````````````````````````````````````````````````````````
  372. M````````````````````````````````````````````````````````````
  373. M````````````````````````````````````````````````````````````
  374. M````````````````````````````````````````````````````````````
  375. M````````````````````````````````````````````````````````````
  376. M````````````````````````````````````````````````````````````
  377. M````````````````````````````````````````````````````````````
  378. M````````````````````````````````````````````````````````````
  379. M````````````````````````````````````````````````````````````
  380. M````````````````````````````````````````````````````````````
  381. M````````````````````````````````````````````````````````````
  382. M````````````````````````````````````````````````````````````
  383. M````````````````````````````````````````````````````````````
  384. M````````````````````````````````````````````````````````````
  385. M````````````````````````````````````````````````````````````
  386. M````````````````````````````````````````````````````````````
  387. M````````````````````````````````````````````````````````````
  388. M````````````````````````````````````````````````````````````
  389. M````````````````````````````````````````````````````````````
  390. M````````````````````````````````````````````````````````````
  391. M````````````````````````````````````````````````````````````
  392. M````````````````````````````````````````````````````````````
  393. M````````````````````````````````````````````````````````````
  394. M````````````````````````````````````````````````````````````
  395. M````````````````````````````````````````````````````````````
  396. M````````````````````````````````````````````````````````````
  397. M````````````````````````````````````````````````````````````
  398. M````````````````````````````````````````````````````````````
  399. M````````````````````````````````````````````````````````````
  400. M````````````````````````````````````````````````````````````
  401. M````````````````````````````````````````````````````````````
  402. M````````````````````````````````````````````````````````````
  403. M````````````````````````````````````````````````````````````
  404. M````````````````````````````````````````````````````````````
  405. M````````````````````````````````````````````````````````````
  406. M````````````````````````````````````````````````````````````
  407. M````````````````````````````````````````````````````````````
  408. M````````````````````````````````````````````````````````````
  409. M````````````````````````````````````````````````````````````
  410. M````````````````````````````````````````````````````````````
  411. M````````````````````````````````````````````````````````````
  412. M````````````````````````````````````````````````````````````
  413. M````````````````````````````````````````````````````````````
  414. M````````````````````````````````````````````````````````````
  415. M````````````````````````````````````````````````````````````
  416. M````````````````````````````````````````````````````````````
  417. M````````````````````````````````````````````````````````````
  418. M````````````````````````````````````````````````````````````
  419. M````````````````````````````````````````````````````````````
  420. M````````````````````````````````````````````````````````````
  421. M````````````````````````````````````````````````````````````
  422. M````````````````````````````````````````````````````````````
  423. M````````````````````````````````````````````````````````````
  424. M````````````````````````````````````````````````````````````
  425. M````````````````````````````````````````````````````````````
  426. M````````````````````````````````````````````````````````````
  427. M````````````````````````````````````````````````````````````
  428. M````````````````````````````````````````````````````````````
  429. M````````````````````````````````````````````````````````````
  430. M````````````````````````````````````````````````````````````
  431. M````````````````````````````````````````````````````````````
  432. M````````````````````````````````````````````````````````````
  433. M````````````````````````````````````````````````````````````
  434. M````````````````````````````````````````````````````````````
  435. M````````````````````````````````````````````````````````````
  436. M````````````````````````````````````````````````````````````
  437. M````````````````````````````````````````````````````````````
  438. M````````````````````````````````````````````````````````````
  439. M````````````````````````````````````````````````````````````
  440. M````````````````````````````````````````````````````````````
  441. M````````````````````````````````````````````````````````````
  442. M````````````````````````````````````````````````````````````
  443. M````````````````````````````````````````````````````````````
  444. M````````````````````````````````````````````````````````````
  445. M````````````````````````````````````````````````````````````
  446. M````````````````````````````````````````````````````````````
  447. M````````````````````````````````````````````````````````````
  448. M````````````````````````````````````````````````````````````
  449. M````````````````````````````````````````````````````````````
  450. M````````````````````````````````````````````````````````````
  451. M````````````````````````````````````````````````````````````
  452. M````````````````````````````````````````````````````````````
  453. M````````````````````````````````````````````````````````````
  454. M````````````````````````````````````````````````````````````
  455. H````````````````````````````````````````````````!```````
  456. `
  457. end
  458. \\__END__OF__shark/shark__FILE\\
  459. chmod 755 shark/shark
  460. echo unsharking shark/Makefile
  461. cat > shark/Makefile << '\\__END__OF__shark/Makefile__FILE\\'
  462. shark: shark.c
  463.     cc -O2 -o shark shark.c
  464.     strip shark
  465. \\__END__OF__shark/Makefile__FILE\\
  466. chmod 644 shark/Makefile
  467. echo unsharking shark/shark.lsm
  468. cat > shark/shark.lsm << '\\__END__OF__shark/shark.lsm__FILE\\'
  469. Begin2
  470. Title        = shark - shell archiver
  471. Version      = 0.1.1
  472. Desc1        = Simple SHELL ARCHIVER: usefull to pack data in news/mail messages
  473. desc2        = Stores files, recursive directories, char/block devices, pipes,
  474. Desc3        = symbolic links, saves permitions, and auto-uuencodes binary files.
  475. Desc4        = The resulting package is shell script that unpackages itself.
  476. Desc5        = This is an alfa release - so you must be very carefull ...
  477. Author       = Fernando J. G. Pereira
  478. AuthorEmail  = fjp@minerva.inesc.pt
  479. Maintainer   = Fernando J. G. Pereira
  480. MaintEmail   = fjp@minerva.inesc.pt
  481. Site1        = sunsite.unc.edu
  482. Path1        = 
  483. File1        = shark.sh
  484. FileSize1    = 21k
  485. Site2        = nic.funet.fi
  486. Path2        =
  487. File2        = shark.sh
  488. FileSize2    = 21k
  489. Site3        = 
  490. Path3        =
  491. File3        =
  492. FileSize3    =
  493. Site4        =
  494. Path4        =
  495. File4        =
  496. FileSize4    =
  497. Required1    = Linux
  498. Required2    = 
  499. Required3    =
  500. Required4    =
  501. CopyPolicy1  = Free
  502. CopyPolicy2  =
  503. Keywords     = shell-archive - shell-scripts
  504. Comment1     =
  505. Comment2     =
  506. Comment3     =
  507. Comment4     =
  508. RelFiles1    = 
  509. RelFiles2    =
  510. RelFiles3    =
  511. Entered      = 16/2/94
  512. EnteredBy    = fjp
  513. CheckedEmail =
  514. End
  515. \\__END__OF__shark/shark.lsm__FILE\\
  516. chmod 644 shark/shark.lsm
  517. chmod 755 shark
  518.